<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="js/echarts.min.js"></script>
</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
    var myChart = echarts.init(document.getElementById('main'));
    option = {
        title: {
            text: 'Relationship between chemical fertilizer and grain'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['fertilizer', 'grain']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['1959', '1960', '1961', '1962', '1963', '1964', '1965']
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name: 'fertilizer',
                type: 'line',
                stack: 'Total',
                data: [120, 132, 101, 134, 90, 230, 210]
            },
            {
                name: 'grain',
                type: 'line',
                stack: 'Total',
                data: [220, 182, 191, 234, 290, 330, 310]
            }
        ]
    };
    myChart.setOption(option);
</script>
</body>
</html>